package com.ssm.sample.controller.controllers;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.ssm.sample.controller.base.BaseController;
import com.ssm.sample.entity.Page;
import com.ssm.sample.facade.facades.Facades;
import com.ssm.sample.service.services.Services;
import com.ssm.sample.util.PageData;

@Controller
@RequestMapping("/TestDatabase")
public class Controllers extends BaseController
{
	private Facades facades;
    
	@RequestMapping("/Test")
	public ModelAndView Test() {
		ModelAndView mv = this.getModelAndView();
		PageData pd = null;
		try {
			pd = this.getPageData();
			List<PageData> list = facades.selectAll(pd);
			mv.addObject("list", list); 
		} catch (Exception e) {
			logger.error(e);
			e.printStackTrace();
		}
		mv.setViewName("/TestDatabase/Test");
		return mv;
	}

}

